<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<div id="box">
			0:0:0
		</div>
		<input type="button" name="" id="" value="开始"onclick="kaishi()" />
		<input type="button" name="" id="" value="暂停"onclick="zanting()" />
		<script type="text/javascript">
			var time = 0;
			var miao = 0;
			var fen = 0;
			var xiaoshi = 0;
			var day = 0;
			var id=0;
			function kaishi () {
				if (id==0) {
					id=setInterval(function() {
				time++;
				var miao = time % 60;
				var fen = parseInt(time / 60);
				var xiaoshi = parseInt(time / 3600);
				var day = parseInt(time / (3600 * 24));
				document.getElementById("box").innerHTML=(+xiaoshi+":"+fen+":"+miao)
//				document.write(+xiaoshi+":"+fen+":"+miao)
				
			}, 1)
			}
				}
				
			function zanting () {
				clearInterval(id)
				id=0;
				document.getElementById("box")
			}
			
			
			
		</script>
	</body>

</html>